package com.common.constant;

import io.swagger.v3.oas.annotations.media.Schema;

/**
 * @author: stefanie-zy
 * @time: 2024/1/25-16:14
 * @description: 正则表达式参数
 */
@Schema(name = "静态参数-正则表达式格式")
public class GrepConstant {

    @Schema(description = "中文")
    public static final String CHINESE = "[一-龥]+";

    @Schema(description = "手机号")
    public static final String PHONE_NUMBER = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(16[5,6])|(17[0-8])|(18[0-9])|(19[1、5、8、9]))\\d{8}$";

    @Schema(description = "邮箱")
    public static final String EMAIL = "^(\\w+([-.][A-Za-z0-9]+)*){3,18}@\\w+([-.][A-Za-z0-9]+)*\\.\\w+([-.][A-Za-z0-9]+)*$";

    @Schema(description = "身份证")
    public static final String ID_CARD = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|" +
            "(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)";

    @Schema(description ="字典类型")
    public static final String DICT_TYPE = "^[a-z][a-z0-9_]*$";
}
